package com.education.wisdom.service.impl;


import com.education.common.utils.Convert;
import com.education.wisdom.mapper.CatalogAppraisalMapper;
import com.education.wisdom.pojo.CatalogAppraisal;
import com.education.wisdom.service.ICatalogAppraisalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 职业技能鉴定目录体系 服务层实现
 *
 * @author ruoyi
 * @date 2019-06-19
 */
@Service
public class CatalogAppraisalServiceImpl implements ICatalogAppraisalService {
    @Autowired
    private CatalogAppraisalMapper catalogAppraisalMapper;

    /**
     * 查询职业技能鉴定目录体系信息
     *
     * @param catalogCode 职业技能鉴定目录体系ID
     * @return 职业技能鉴定目录体系信息
     */
    @Override
    public CatalogAppraisal selectCatalogAppraisalById(String catalogCode) {
        return catalogAppraisalMapper.selectCatalogAppraisalById(catalogCode);
    }

    @Override
    public CatalogAppraisal selectCatalogAppraisalByCatalogId(Integer id) {
        return catalogAppraisalMapper.selectCatalogAppraisalByCatalogId(id);
    }

    /**
     * 查询职业技能鉴定目录体系列表
     *
     * @param catalogAppraisal 职业技能鉴定目录体系信息
     * @return 职业技能鉴定目录体系集合
     */
    @Override
    public List<CatalogAppraisal> selectCatalogAppraisalList(CatalogAppraisal catalogAppraisal) {
        return catalogAppraisalMapper.selectCatalogAppraisalList(catalogAppraisal);
    }

    /**
     * 新增职业技能鉴定目录体系
     *
     * @param catalogAppraisal 职业技能鉴定目录体系信息
     * @return 结果
     */
    @Override
    public int insertCatalogAppraisal(CatalogAppraisal catalogAppraisal) {
        return catalogAppraisalMapper.insertCatalogAppraisal(catalogAppraisal);
    }

    /**
     * 修改职业技能鉴定目录体系
     *
     * @param catalogAppraisal 职业技能鉴定目录体系信息
     * @return 结果
     */
    @Override
    public int updateCatalogAppraisal(CatalogAppraisal catalogAppraisal) {
        return catalogAppraisalMapper.updateCatalogAppraisal(catalogAppraisal);
    }

    /**
     * 删除职业技能鉴定目录体系对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCatalogAppraisalByIds(String ids) {
        return catalogAppraisalMapper.deleteCatalogAppraisalByIds(Convert.toStrArray(ids));
    }

    @Override
    public void deleteByCatalogId(Integer catalogId) {
        catalogAppraisalMapper.deleteByCatalogId(catalogId);
    }

}
